<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <style>

    </style>
</head>

<body>
    <div id="app">
        <my-header></my-header>
        <my-footer></my-footer>
    </div>

    <template id="temp1">
        <div>
            <h1>全局组件header</h1>
        </div>
    </template>
    <template id="temp2">
        <div>
            <h1>全局组件footer</h1>
        </div>
    </template>
</body>
<script>
    Vue.component('myHeader', {
        template: '#temp1'
    })

    Vue.component('myFooter', {
        template: '#temp2'
    })

    var vm = new Vue({
        el: '#app',
        data: {}
    })
</script>

</html>